<?php
header("Content-type: text/html; charset= UTF-8");
require_once '../../includes/global.php';
//error_reporting(E_ALL);
$table_pre = 'se_';
$real_time_table = 'price';
$room_field = 'room';
$time_field = 'date';
$num_field = 'price';
define('INT_MONTH', 86400 * 6);

//房型 信息
$room_info = Dga('room', "id={$_GET['bdid']}");

$bdid = $_GET ['bdid'];
$bdtid = $_GET ['bdtid'];
switch ($_GET ['op']) {
    case 'next' :
        $temp_ts = $_GET['ts'];
        $temp_month = date("n", $temp_ts) + 1;
        $temp_year = date('Y', $temp_ts);
        $timestamp = mktime(0, 0, 0, $temp_month, 1, $temp_year);
        break;

    case 'last' :
        $temp_ts = $_GET['ts'];
        $temp_month = date("n", $temp_ts) - 1;
        $temp_year = date('Y', $temp_ts);
        $timestamp = mktime(0, 0, 0, $temp_month, 1, $temp_year);
        break;

    case 'forward' :
        $timestamp = mktime(0, 0, 0, $_GET['month'], 1, $_GET['year']);
        break;

    case 'week' :
        $arr = explode('-', $_GET['startWeekDate']);
        $s_year = $arr [0];
        $s_month = $arr [1];
        $s_day = $arr [2];
        $arr = explode('-', $_GET['endWeekDate']);
        $e_year = $arr [0];
        $e_month = $arr [1];
        $e_day = $arr [2];
        $s_ts = mktime(0, 0, 0, $s_month, $s_day, $s_year);
        $e_ts = mktime(0, 0, 0, $e_month, $e_day, $e_year);
        $var_week_num = $_GET['week_num'];
        $var_week_room = $_GET['week_room'];
        for ($i = 0; $i < count($var_week_num); $i++) {
            if (isset($var_week_num [$i]) && (!empty($var_week_num [$i]) || $var_week_num [$i] == 0) && $var_week_num [$i] != '') {
                $save_week [] = $i;
                $save_room1 [] = $var_week_room [$i];
                $save_num1 [] = $var_week_num [$i];
            }
        }
        //Jc($save_week);
        for ($var_ts = $s_ts; $var_ts <= $e_ts; $var_ts += 86400) {
            for ($i = 0; $i < count($save_week); $i++) {
                if (date('w', $var_ts) == $save_week [$i]) {
                    $save_date [] = $var_ts;
                    $save_room [] = $save_room1 [date('w', $var_ts)];
                    $save_num [] = $save_num1 [date('w', $var_ts)];
                }
            }
        }
        //Jc($save_num);
        //Jc($save_room);
        //Jc($save_date);
        $gid = Bic();
        for ($i = 0; $i < count($save_date); $i++) {
            $read_info = Dz("select * from " . $table_pre . $real_time_table . " where bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "=" . $save_date [$i] . " and del!=1");
            if (count($read_info) != 0) {
                $read_info = Dz("UPDATE " . $table_pre . $real_time_table . " SET " . $num_field . "='" . $save_num [$i] . "'," . $room_field . "='" . $save_room [$i] . "' WHERE bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "=" . $save_date [$i] . " AND del!=1");
                //echo "UPDATE " . $table_pre . $real_time_table . " SET " . $num_field . "='" . $save_num [$i] . "'," . $room_field . "='" . $save_room [$i] . "' WHERE bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "=" . $save_date [$i] . " AND del!=1";
                //echo "<br/>";
            } else {
                $read_info = Dz("INSERT INTO " . $table_pre . $real_time_table . " (" . $time_field . "," . $num_field . "," . $room_field . ",gid,bdtid,bdid) VALUES (" . $save_date [$i] . ",'" . $save_num [$i] . "','" . $save_room [$i] . "','" . $gid . "','" . $bdtid . "','" . $bdid . "')");
                //echo "INSERT INTO " . $table_pre . $real_time_table . " (" . $time_field . "," . $num_field . "," . $room_field . ",gid,bdtid,bdid) VALUES (" . $save_date [$i] . ",'" . $save_num [$i] . "','" . $save_room [$i] . "','" . $gid . "','" . $bdtid . "','" . $bdid . "')";
                //echo "<br/>";
            }
        }
        $timestamp = time();
        break;

    case 'span' :
        $arr = explode('-', $_GET['startWeekDate']);
        $s_year = $arr[0];
        $s_month = $arr[1];
        $s_day = $arr[2];
        $arr = explode('-', $_GET['endWeekDate']);
        $e_year = $arr[0];
        $e_month = $arr[1];
        $e_day = $arr[2];
        $s_ts = mktime(0, 0, 0, $s_month, $s_day, $s_year);
        $e_ts = mktime(0, 0, 0, $e_month, $e_day, $e_year);
        $save_default_num = $_GET['default_num'];
        $save_default_room = $_GET['default_room'];

        for ($var_ts = $s_ts; $var_ts <= $e_ts; $var_ts += 86400) {
            $save_date [] = $var_ts;
            $save_num [] = $save_default_num;
            $save_room [] = $save_default_room;
        }
        // Jc($save_date);
        // Jc($save_num);
        $gid = bic();
        for ($i = 0; $i < count($save_date); $i++) {
            $read_info = Dz("select * from " . $table_pre . $real_time_table . " where bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "=" . $save_date [$i] . " and del!=1");
            if (count($read_info) != 0) {
                $read_info = Dz("UPDATE " . $table_pre . $real_time_table . " SET " . $num_field . "='" . $save_num [$i] . "'," . $room_field . "='" . $save_room [$i] . "' WHERE bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "=" . $save_date [$i] . " AND del!=1");
            } else {
                $read_info = Dz("INSERT INTO " . $table_pre . $real_time_table . " (" . $time_field . "," . $num_field . "," . $room_field . ",gid,bdtid,bdid) VALUES (" . $save_date [$i] . ",'" . $save_num [$i] . "','" . $save_room [$i] . "','" . $gid . "','" . $bdtid . "','" . $bdid . "')");
            }
        }

        $timestamp = time();
        break;

    case 'moren' :
        $save_default_num = $_GET['default_num'];
        $save_year = $_GET['year'];
        $save_month = $_GET['month'];

        $read_info = Dz("select * from " . $table_pre . $real_time_table . " where bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "=1 and del!=1");
        if (count($read_info) != 0) {
            $read_info = Dz("UPDATE " . $table_pre . $real_time_table . " SET price='" . $save_default_num . "' WHERE bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "=1 AND del!=1");
        } else {
            $read_info = Dz("INSERT INTO " . $table_pre . $real_time_table . " (" . $time_field . "," . $num_field . ",gid,bdtid,bdid) VALUES (1,'" . $save_default_num . "','" . $gid . "','" . $bdtid . "','" . $bdid . "')");
        }
        $timestamp = mktime(0, 0, 0, $save_month, 1, $save_year);
        break;

    case 'save' :
        $var_num = $_GET [num];
        $save_year = $_GET [year];

        $save_month = $_GET [month];
        $read_info = Dz("select * from " . $table_pre . $real_time_table . " where bdtid=" . $bdtid . " and bdid=" . $bdid . " and date=1 and del!=1");
        $save_default_num = $read_info [0] [price];
        $save_date = '';
        for ($i = 1; $i < 32; $i++) {
            if (isset($var_num [$i]) && $var_num [$i] != '') {
                if ($var_num [$i] != $save_default_num) {
                    $save_date [] = mktime(0, 0, 0, $save_month, $i, $save_year);
                    $save_num [] = $var_num [$i];
                    $save_room [] = $var_num [$i . '_room'];
                } else {
                    $del_date = mktime(0, 0, 0, $save_month, $i, $save_year);
                    $exe = Dz("UPDATE " . $table_pre . $real_time_table . " SET del=1 WHERE date=" . $del_date . " and bdtid=" . $bdtid . " and bdid=" . $bdid);
                }
            }
        }
        for ($i = 0; $i < count($save_date); $i++) {
            $read_info = Dz("select * from " . $table_pre . $real_time_table . " where bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "='" . $save_date [$i] . "' and del!=1");
            if ($read_info != '') {
                $read_info = Dz("UPDATE " . $table_pre . $real_time_table . " SET " . $num_field . "='" . $save_num [$i] . "'," . $room_field . "=" . $save_room[$i] . " WHERE  bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "='" . $save_date [$i] . "' AND del!=1");
            } else {
                $gid = bic();
                $read_info = Dz("INSERT INTO " . $table_pre . $real_time_table . " (" . $time_field . "," . $num_field . "," . $room_field . ",gid,bdtid,bdid) VALUES ('" . $save_date [$i] . "','" . $save_num [$i] . "'," . $save_room[$i] . ",'" . $gid . "','" . $bdtid . "','" . $bdid . "')");
            }
        }
        $timestamp = mktime(0, 0, 0, $save_month, 1, $save_year);
        break;

    default :

        $timestamp = time();
}

$today_year = date('Y', time());
$today_month = date('n', time());
$today_day = date('j', time());
$today_week = date('w', time());
$the_year = date('Y', $timestamp);
$the_month = date('n', $timestamp);
$month_days = date('t', $timestamp);
$begin_week = date("w", mktime(0, 0, 0, $the_month, 1, $the_year));
$month_s = mktime(0, 0, 0, $the_month, 1, $the_year);
$month_e = mktime(0, 0, 0, $the_month, $month_days, $the_year);

$read_info = Dz("select * from " . $table_pre . $real_time_table . " where bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . ">=" . $month_s . " and " . $time_field . "<=" . $month_e . " and del!=1");
$common_num = Dz("select * from " . $table_pre . $real_time_table . " where bdtid=" . $bdtid . " and bdid=" . $bdid . " and " . $time_field . "=1 and del!=1");

for ($i = 0; $i < count($read_info); $i++) {
    $var_read_day = date('j', $read_info [$i] [$time_field]);
    $read_day [] = $var_read_day;
    $read_num [] = $read_info [$i] [$num_field];
    $room_num [] = $read_info [$i] ['room'];
}

//print_r($read_day);
//print_r($read_num);
//Jc($room_num);
function _week($w) {
    switch ($w) {
        case 1:return "一";
        case 2:return "二";
        case 1:return "三";
        case 2:return "四";
        case 1:return "五";
        case 2:return "六";
        default :return "日";
    }
}
?>
<!DOCTYPE>
<html>
    <head>
        <meta charset=utf-8" />
        <title>实时房价/房态管理</title>
        <style>
            body {background-color: #666666;font-size: 14px;color:#493424;}
            #wrap {background-color: #FFFFEB;padding: 20px 50px;width: 94%;}
            .th {font-size: 12px;width: 80px;height: 45px;border: #999999 1px solid;background: #F4C99C;}
            .color_red{color:#D50000;}
            em {font-size: 12px;width: 70px;padding: 0;height: 20px;line-height: 20px;font-style: normal;}
            .input {border: #CCCCCC 1px solid;line-height: 12px;height: 15px;padding: 0;}
            .can {border: #999999 1px solid;width: 100%;}
            .can2 {width: 100%;}
            .content {width: 730px;border: #666666 1px solid;padding: 5px;padding-left: 50px;padding-right: 50px;}
            .box,.box2,.box3{border: 1px #666666 solid; width: 700px; padding: 10px;}
            .box2{}
            .box3{}
            .title{margin: 0}
            .STYLE1{color: #D50000;}
            .STYLE2{color: #D50000;}
            .th1{width: 195px;}
            .th2{width: 95px;}
            .th3{width: 95px;}
            .cale_con_li{padding:2px 0;color:#493424;}
        </style>
        <script language="javascript" type="text/javascript" src="../../Plug-in/My97/WdatePicker.js"></script>
    </head>
    <body>
        <div id="wrap">
            <h2 class="title"><?php echo $room_info['title'] ?></h1>
                <div class="content">
                    <table class="can2" cellpadding="0" cellspacing="0">
                        <tr style="font-size: 12px; vertical-align: middle;">
                            <th colspan="4">
                        <form action="real_time.php" method="GET" name="forward_month">
                            <table class="can2" cellpadding="0" cellspacing="0">
                                <tr style="font-size: 12px; vertical-align: middle;">
                                    <th align="center" colspan="3">今日：<?php echo $today_year . '年 ' . $today_month . '月 ' . $today_day . '日 ' . '星期' . _week($today_week) ?></th>
                                    <th colspan="4">
                                        <input type="hidden" name="op" value="forward" />
                                        <input name="year" type="text" size="4" maxlength="6" value="<?php echo $today_year; ?>" /> 年
                                        <select name="month" onchange="document.forward_month.submit();">
                                            <?php
                                            for ($i = 1; $i <= 12; $i++) {
                                                $selected = ($_GET['month'] == $i) ? 'selected' : ($today_month == $i) ? 'selected' : '';
                                                echo <<<EQT
                                <option {$selected} value="{$i}">{$i}</option>
EQT;
                                            }
                                            ?>
                                        </select> 月
                                        <input type="hidden" name="bdid" value="<?php echo $_GET['bdid']; ?>" />
                                        <input type="hidden" name="bdtid" value="<?php echo $_GET['bdtid']; ?>" />
                                        <input type="hidden" name="realtime_show_price" value="<?php echo $_GET['realtime_show_price'] ?>" />
                                        <input type="hidden" name="realtime_show_room" value="<?php echo $_GET['realtime_show_room'] ?>" />
                                        <input type="submit" value="转到" />
                                    </th>
                                </tr>
                            </table>
                        </form>
                        </th>
                        </tr>
                    </table>
                    详细设置：
                    <div class="box">
                        <form method="GET" action="real_time.php">
                            <table class="can2" cellpadding="0" cellspacing="0">
                                <tr style="height: 25px; font-size: 16px; vertical-align: text-top;">
                                    <th colspan="2"><a href="real_time.php?op=last&ts=<?php echo $timestamp; ?>&bdid=<?php echo $_GET [bdid]; ?>&bdtid=<?php echo $_GET [bdtid]; ?>&realtime_show_price=<?php echo $_GET['realtime_show_price'] ?>&realtime_show_room=<?php echo $_GET['realtime_show_room'] ?>" class="color_red">上个月</a></th>
                                    <th colspan="3"><span><?php echo $the_year . "年  " . $the_month . "月" ?></span></th>
                                    <th colspan="2"><a href="real_time.php?op=next&ts=<?php echo $timestamp; ?>&bdid=<?php echo $_GET [bdid]; ?>&bdtid=<?php echo $_GET [bdtid]; ?>&realtime_show_price=<?php echo $_GET['realtime_show_price'] ?>&realtime_show_room=<?php echo $_GET['realtime_show_room'] ?>" class="color_red">下个月</a></th>
                                </tr>
                            </table>
                            <table class="can">
                                <tr style="font-size: 12px; height: 30px;">
                                    <th><span class="STYLE1">星期日</span></th>
                                    <th>星期一</th>
                                    <th>星期二</th>
                                    <th>星期三</th>
                                    <th>星期四</th>
                                    <th>星期五</th>
                                    <th><span class="STYLE2">星期六</span></th>
                                </tr>
                                <input type="hidden" name="op" value="save" />
                                <input type="hidden" name="month" value="<?php echo $the_month; ?>" />
                                <input type="hidden" name="year" value="<?php echo $the_year; ?>" />
                                <input type="hidden" name="realtime_show_price" value="<?php echo $_GET['realtime_show_price'] ?>" />
                                <input type="hidden" name="realtime_show_room" value="<?php echo $_GET['realtime_show_room'] ?>" />
                                <?php
                                $var_day = 1;
                                for ($week_num = 0; $week_num < 6; $week_num++) {
                                    ?>
                                    <tr class="tr">
                                        <?php for ($week_i = 0; $week_i < 7; $week_i++) { ?>
                                            <th class="th">
                                                <?php if (($week_num == 0 && $week_i < $begin_week) || intval($var_day) > intval($month_days)) { ?>
                                                    <em>&nbsp;</em> <i>&nbsp;</i>
                                                    <?php
                                                } else {
                                                    for ($i = 0; $i <= count($read_day); $i++) {
                                                        if ($read_day [$i] == $var_day) {
                                                            $input_value = $read_num [$i];
                                                            $room_value = $room_num [$i];
                                                            break;
                                                        } else {
                                                            $common_num [0] [$num_field] != "" && $input_value = $common_num [0] [$num_field];
                                                            $common_num [0] [$num_field] == "" && $input_value = 0;
                                                            $room_value = 0;
                                                        }
                                                    }

                                                    if ($week_i == 0) {
                                                        ?>
                                                        <em class="STYLE1"><?php echo $the_month . "月" . $var_day . '日'; ?></em>
                                                <div class="cale_con_li cale_con_price" style="<?php echo $_GET['realtime_show_price'] == 1 ? '' : 'display:none;'; ?>">
                                                    <label for="inp_pri_<?php echo $var_day; ?>">房价&nbsp;</label><i><input id="inp_pri_<?php echo $var_day; ?>" class="input" type="text" name="num[<?php echo $var_day; ?>]" value="<?php echo $input_value; ?>" size="6" maxlength="6" /></i>
                                                </div>
                                                <!-- ############### 房态 ############### -->
                                                <div class="cale_con_li cale_con_room" style="<?php echo $_GET['realtime_show_room'] == 1 ? '' : 'display:none;'; ?>">
                                                    <label for="inp_room_<?php echo $var_day; ?>">房态&nbsp;</label><i ><input id="inp_room_<?php echo $var_day; ?>" class="input" type="text" name="num[<?php echo $var_day; ?>_room]" value="<?php echo $room_value; ?>" size="6" maxlength="6" /></i>
                                                </div>
                                                <?php
                                            } else {
                                                ?>
                                                <em><?php echo $the_month . "月" . $var_day . '日'; ?></em>
                                                <div class="cale_con_li cale_con_price" style="<?php echo $_GET['realtime_show_price'] == 1 ? '' : 'display:none;'; ?>">
                                                    <label for="inp_pri_<?php echo $var_day; ?>">房价&nbsp;</label><i><input id="inp_pri_<?php echo $var_day; ?>" class="input" type="text" name="num[<?php echo $var_day; ?>]" value="<?php echo $input_value; ?>" size="6" maxlength="6" /></i>
                                                </div>
                                                <!-- ############### 房态 ############### -->
                                                <div class="cale_con_li cale_con_room" style="<?php echo $_GET['realtime_show_room'] == 1 ? '' : 'display:none;'; ?>">
                                                    <label for="inp_room_<?php echo $var_day; ?>">房态&nbsp;</label><i ><input id="inp_room_<?php echo $var_day; ?>" class="input" type="text" name="num[<?php echo $var_day; ?>_room]" value="<?php echo $room_value; ?>" size="6" maxlength="6" /></i>
                                                </div>
                                                <?php
                                            }
                                            $var_day++;
                                        }
                                        ?>
                                        </th>
                                    <?php } ?>
                                    </tr>
                                <?php } ?>
                                <tr style="height: 50px;">
                                    <th colspan="5"></th>
                                    <th colspan="1"><input type="hidden" name="bdid" value="<?php echo $_GET [bdid]; ?>" /> <input type="hidden" name="bdtid" value="<?php echo $_GET [bdtid]; ?>" /><input class="edit" type="submit" value="提交" /></th>
                                    <th colspan="1"><input type="reset" value="重置" /></th>
                                </tr>
                            </table>
                        </form>
                    </div>
                    <br />
                    按星期设置：
                    <div class="box2" style="<?php echo $_GET['realtime_show_price'] == 1 ? '' : 'display:none;'; ?>">
                        <form action="real_time.php" method="get"><input type="hidden" name="op" value="week" />
                            <input type="hidden" name="bdid" value="<?php echo $_GET['bdid']; ?>" />
                            <input type="hidden" name="bdtid" value="<?php echo $_GET['bdtid']; ?>" />
                            <input type="hidden" name="realtime_show_price" value="<?php echo $_GET['realtime_show_price'] ?>" />
                            <input type="hidden" name="realtime_show_room" value="<?php echo $_GET['realtime_show_room'] ?>" />
                            <table class="can">
                                <tr>
                                    <th class="th">
                                        <span class="STYLE1">星期日</span>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sun">房价&nbsp;</label><input id="inp_pri_sun" class="input" type="text" name="week_num[0]" value="0" size="6" maxlength="6" />
                                </div>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sun">房态&nbsp;</label><input id="inp_pri_sun" class="input" type="text" name="week_room[0]" value="0" size="6" maxlength="6" />
                                </div>
                                </th>
                                <th class="th">
                                    星期一
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_mon">房价&nbsp;</label><input id="inp_pri_mon" class="input" type="text" name="week_num[1]" value="0" size="6" maxlength="6" />
                                </div>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sun">房态&nbsp;</label><input id="inp_pri_sun" class="input" type="text" name="week_room[1]" value="0" size="6" maxlength="6" />
                                </div>
                                </th>
                                <th class="th">
                                    星期二
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_tue">房价&nbsp;</label><input id="inp_pri_tue" class="input" type="text" name="week_num[2]" value="0" size="6" maxlength="6" />
                                </div>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sun">房态&nbsp;</label><input id="inp_pri_sun" class="input" type="text" name="week_room[2]" value="0" size="6" maxlength="6" />
                                </div>
                                </th>
                                <th class="th">
                                    星期三
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_wed">房价&nbsp;</label><input id="inp_pri_wed" class="input" type="text" name="week_num[3]" value="0" size="6" maxlength="6" />
                                </div>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sun">房态&nbsp;</label><input id="inp_pri_sun" class="input" type="text" name="week_room[3]" value="0" size="6" maxlength="6" />
                                </div>
                                </th>
                                <th class="th">
                                    星期四
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_thu">房价&nbsp;</label><input id="inp_pri_thu" class="input" type="text" name="week_num[4]" value="0" size="6" maxlength="6" />
                                </div>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sun">房态&nbsp;</label><input id="inp_pri_sun" class="input" type="text" name="week_room[4]" value="0" size="6" maxlength="6" />
                                </div>
                                </th>
                                <th class="th">
                                    星期五
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_fri">房价&nbsp;</label><input id="inp_pri_fri" class="input" type="text" name="week_num[5]" value="0" size="6" maxlength="6" />
                                </div>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sun">房态&nbsp;</label><input id="inp_pri_sun" class="input" type="text" name="week_room[5]" value="0" size="6" maxlength="6" />
                                </div>
                                </th>
                                <th class="th">
                                    <span class="STYLE2">星期六</span>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sat">房价&nbsp;</label><input id="inp_pri_sat" class="input" type="text" name="week_num[6]" value="0" size="6" maxlength="6" />
                                </div>
                                <div class="cale_con_li cale_con_price">
                                    <label for="inp_pri_sun">房态&nbsp;</label><input id="inp_pri_sun" class="input" type="text" name="week_room[6]" value="0" size="6" maxlength="6" />
                                </div>
                                </th>
                                </tr>
                                <tr>
                                    <th colspan="2">开始日期:<input id="startWeekDate" name="startWeekDate" type="text" size="13" class="Wdate" style="text-align: center;" value="<?php echo date("Y-m-d"); ?>" onfocus="WdatePicker({isShowClear:false,readOnly:true})" /></th>
                                    <th colspan="2">结束日期:<input id="endWeekDate" name="endWeekDate" type="text" size="13" class="Wdate" style="text-align: center;" value="<?php echo date("Y-m-d", time() + INT_MONTH); ?>" onfocus="WdatePicker({isShowClear:false,readOnly:true})" /></th>
                                    <th>&nbsp;</th>
                                    <th><input class="edit" type="submit" value="提交" /></th>
                                    <th><input type="reset" value="重置" /></th>
                                </tr>
                            </table>
                        </form>
                    </div>
                    <br />
                    按日期区间设置：
                    <div class="box3"  style="<?php echo $_GET['realtime_show_price'] == 1 ? '' : 'display:none;'; ?>">
                        <form action="real_time.php" method="get">
                            <input type="hidden" name="op" value="span" />
                            <input type="hidden" name="bdid" value="<?php echo $_GET['bdid']; ?>" />
                            <input type="hidden" name="bdtid" value="<?php echo $_GET['bdtid']; ?>" />
                            <input type="hidden" name="realtime_show_price" value="<?php echo $_GET['realtime_show_price'] ?>" />
                            <input type="hidden" name="realtime_show_room" value="<?php echo $_GET['realtime_show_room'] ?>" />
                            <table class="can">
                                <tr>
                                    <th class="th1">开始日期:<input id="startWeekDate" name="startWeekDate" type="text" size="13" class="Wdate" style="text-align: center;" value="<?php echo date("Y-m-d"); ?>" onfocus="WdatePicker({isShowClear:false,readOnly:true})" /></th>
                                    <th class="th1">结束日期:<input id="endWeekDate" name="endWeekDate" type="text" size="13" class="Wdate" style="text-align: center;" value="<?php echo date("Y-m-d", time() + INT_MONTH); ?>" onfocus="WdatePicker({isShowClear:false,readOnly:true})" /></th>
                                    <th class="th3">&nbsp;</th>
                                    <th class="th3"><input class="edit" type="submit" value="提交" /></th>
                                    <th class="th3"><input type="reset" value="重置" /></th>
                                </tr>
                                <tr>
                                    <th>房价区间值：<input type="text" name="default_num" size="6" maxlength="5" /></th>
                                </tr>
                                <tr>
                                    <th>房态区间值：<input type="text" name="default_room" size="6" maxlength="5" /></th>
                                </tr>
                            </table>
                        </form>
                    </div>
                </div>
        </div>
    </body>
</html>